<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AlertPayStreamColumn extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('pay_stream', function (Blueprint $table) {
            $table->unsignedTinyInteger('isPaidIn')->default(1)->after('payPrice')->comment('是否计入实收 0 否 1 是');
            $table->unsignedInteger('payChannel')->default(0)->change();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //  `payChannel` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '支付渠道 1支付宝直连 2微信直连 3现金 4富友',
        Schema::table('pay_stream', function (Blueprint $table) {
            $table->dropColumn('isPaidIn');
            $table->unsignedInteger('payChannel')->default(0)->change();
        });
    }
}
